#pragma once

#include "CanProtocol.h"

class CGlobalVariable
{
public:
	CGlobalVariable(void);
	~CGlobalVariable(void);

public:
	CCanProtocol m_can;
	

public:
	CString      m_cs_sbl_filepath;
	CString      m_cs_srecord_filepath;

public:
	unsigned int g_u32_SecurityAlgorithm(BYTE w_seed[],BYTE SECURITYCONSTANT[]);

	CStdioFile   m_logFile;
	bool         m_start;
	
};


class  CHex2Bin
{
public:

	char    Fill;

	int     BinLength;
	int     cFail;
	CString  InfoString;

	CHex2Bin(void);

	bool __fastcall CharToByte(char *pChar, unsigned char *pByte);
	DWORD __fastcall CStringIDToDword(CString csID);
	int  __fastcall Convert(char *sfile, unsigned char **dbuf, unsigned int *Length, unsigned int * BeginAddr);
	// sfile: soutce file
	// dfile: dest file
	// dbuf : dest buffer
	// length :length limit dfile and dbuf, also return true length,
	//      when use dbuf or dfile, length can not be null
	//      when *length = 0, no limit
	//      when dbuf=dfile=NULL, length can be NULL, for read bin length (store in BinLength )
};


extern  CGlobalVariable glv;